package com.course.domain;

import java.io.Serializable;

import org.apache.commons.lang.builder.HashCodeBuilder;

public class SCId implements Serializable
{
	/**
	 * 
	 */
	private static final long serialVersionUID = 4549831880849863091L;
	private Student student;
	private Course course;

	public Student getStudent()
	{
		return student;
	}

	public void setStudent( Student student )
	{
		this.student = student;
	}

	public Course getCourse()
	{
		return course;
	}

	public void setCourse( Course course )
	{
		this.course = course;
	}
	
	public boolean equals( Object obj )
	{
		if ( obj instanceof SCId )
		{
			SCId s = ( SCId )obj;
			if ( this.course.getId() == s.course.getId() && this.student.getId() == s.student.getId() )
			{
				return true;
			}
		}
		return false;
	}

	public int hashCode()
	{
		return new HashCodeBuilder(-528253723, -475504089)
		.appendSuper(super.hashCode())
		.append(this.course.getId())
		.append(this.student.getId())
		.toHashCode();
	}
	
}
